//设备新增
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any, state: Boolean) {
	const array = [
		{
			type: 'input',
			label: $t('hUPs6rKDixD1KcEUR2Ce'),
			key: 'v_ExerciseName',
			value: data.v_ExerciseName || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			placeHolder: $t('gYyu0pHiaTmpU3w2JftA4'),
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('kJu7Trhi2W73OAVloSf'),
			key: 'n_ProjectId',
			value: data.v_ProjectName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getProjectList,
				searchKey: 'SearchValue',
				value: 'n_Id',
				label: 'v_ItemProjectName',
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('wxMvBrna09FSwOh7I3U0'),
			key: 'v_OrganizeUnit',
			value: data.v_OrganizeUnit || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			placeHolder: $t('qojULlA8WnE6Tp5Qc84Td'),
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('ptfbLg8k0_4Tv4vPcpcAl'),
			key: 'n_BlameEmp',
			value: data.v_BlameEmpName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'EmpName',
				value: 'id',
				label: 'name',
				otherParams: {
					IsChoose: false,
				},
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['change'] }],
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('z5dGh23CbtanLpjTnAiKe'),
			key: 'v_RecordEmpName',
			value: data.v_RecordEmpName || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			placeHolder: '',
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('wLAmFDojJn0zoHj0usCn'),
			key: 'v_ExerciseAddress',
			value: data.v_ExerciseAddress || '',
			placeHolder: $t('xKc2VtAoxuYZnXf49AgUt'),
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},

		{
			type: 'date',
			label: $t('kPdf7XyJNsZxAcoTNhum'),
			key: 'd_ExerciseTime',
			value: data.d_ExerciseTime || '',
			placeholder: $t('xUuIxjDxMKrGxHa2oZw20'),
			//选择一个日期时间
			dateOption: {
				type: 'datetime',
				format: $t('mPu49aXXidMarvkZjNvZl'),
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('yAj1XeDJqYZqupPDotiA'),
			key: 'v_JoinUnit',
			value: data.v_JoinUnit || '',
			placeHolder: $t('vkGHpa0rzSyVguR56HUvC'),
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},
		{
			type: 'radio',
			label: $t('y7Utt281JImFkSqHjAJy'),
			key: 'c_CheckResult',
			value: data.c_CheckResult || '',
			options: [
				{
					value: 'OK',
					label: 'OK',
				},
				{
					value: 'NG',
					label: 'NG',
				},
			],
			disabledStyle: state,
		},

		{
			type: 'textarea',
			label: $t('9RLaVEiJf1Z1Qv15o6Kll'),
			key: 'v_Remake',
			value: data.v_Remake || '',
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('xxAj6fsjvIsQrMdlNpolv'),
			key: 'createdTime',
			value: data.createdTime || '',
			disabledStyle: true,
		},
		{
			type: 'input',
			label: $t('v7AhfaNeGaFoPfZzgpFk'),
			key: 'createdUserName',
			value: data.createdUserName || '',
			disabledStyle: true,
		},
		{
			type: 'input',
			label: $t('hMMqYalIdWhk0McqdxTg'),
			key: 'updatedTime',
			value: data.updatedTime || '',
			disabledStyle: true,
		},
		{
			type: 'input',
			label: $t('2Gu4SnAncIkNclplw6vNj'),
			key: 'updatedUserName',
			value: data.updatedUserName || '',
			disabledStyle: true,
		},
		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('s4KbtSrTfOzuWyRcHgTxx'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'Detail',
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
	];
	return array;
}
